//
//  EchoClient.h
//  EchoServer
//
//  Created by Arthur on 15/6/8.
//  Copyright (c) 2015年 Arthur. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PDMacro.h"

typedef NS_ENUM(NSUInteger,BSDClientCode){
    NOERROR,
    SOCKETERROR,
    CONNECTERROR,
    READERROR,
    WRITEERROR
};
#define ES_MAX_LINE 4096
@interface EchoClient : NSObject
@property (nonatomic) int errorCode;
@property (nonatomic) CFSocketRef socketFd;

- (id)initWithAddr:(NSString*)addr andPort:(int)port;
- (ssize_t)writeToSocket:(CFSocketRef)socketFdNum withStr:(NSString*)str;
- (ssize_t)sendToSocket:(CFSocketRef)lsoFd withData:(NSData*)data;

@end
